2006-01-05 Matthias Clasen <mclasen@redhat.com>
- * gtk/gtkaction.c (connect_proxy): Use a weak reference rather
- than the destroy signal to track proxies going away.
+ * gtk/gtkaction.c (connect_proxy, disconnect_proxy):
+ Use a weak reference rather than the destroy signal to track
+ proxies going away.
* gtk/gtkbindings.c (binding_signal_new): Revert the last change.
- * gtk/gtkaction.c (gtk_action_sync_property): Removed.
+ * gtk/gtkaction.c (gtk_action_sync_property):
+ (gtk_action_sync_stock_id): Removed.
2006-01-05 Rodrigo Moya <rodrigo@novell.com>
2006-01-05 Matthias Clasen <mclasen@redhat.com>
- * gtk/gtkaction.c (connect_proxy): Use a weak reference rather
- than the destroy signal to track proxies going away.
+ * gtk/gtkaction.c (connect_proxy, disconnect_proxy):
+ Use a weak reference rather than the destroy signal to track
+ proxies going away.
* gtk/gtkbindings.c (binding_signal_new): Revert the last change.
- * gtk/gtkaction.c (gtk_action_sync_property): Removed.
+ * gtk/gtkaction.c (gtk_action_sync_property):
+ (gtk_action_sync_stock_id): Removed.
2006-01-05 Rodrigo Moya <rodrigo@novell.com>
gboolean _gtk_menu_is_empty (GtkWidget *menu);
-static void
-gtk_action_sync_stock_id (GtkAction *action,
- GParamSpec *pspec,
- GtkWidget *proxy)
-{
- GtkWidget *image = NULL;
-
- if (GTK_IS_IMAGE_MENU_ITEM (proxy))
- {
- image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (proxy));
-
- if (GTK_IS_IMAGE (image))
- gtk_image_set_from_stock (GTK_IMAGE (image),
- action->private_data->stock_id, GTK_ICON_SIZE_MENU);
- }
-}
-
static gboolean
gtk_action_create_menu_proxy (GtkToolItem *tool_item,
GtkAction *action)
{
g_object_set_qdata (G_OBJECT (proxy), quark_gtk_action_proxy, NULL);
+ g_object_weak_unref (G_OBJECT (proxy), (GWeakNotify)remove_proxy, action);
remove_proxy (action, proxy);
/* disconnect the activate handler */
G_CALLBACK (gtk_action_activate),
action);
- g_signal_handlers_disconnect_by_func (action,
- G_CALLBACK (gtk_action_sync_stock_id), proxy);
-
/* toolbar button specific synchronisers ... */
g_signal_handlers_disconnect_by_func (proxy,
G_CALLBACK (gtk_action_create_menu_proxy),